IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_EntityMetaFieldLinkSelectOne]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_EntityMetaFieldLinkSelectOne]
GO
create procedure cms_sp_EntityMetaFieldLinkSelectOne
(
	@Id int
)
as
select emfl.*,
	   emfl.EntityMetaFieldLinkId as Id,
	   emf.EntityMetaFieldId as EntityMetaField_EntityMetaFieldId,
	   emf.IsSystem as EntityMetaField_IsSystem,
	   emf.MetaFieldName as EntityMetaField_MetaFieldName,
	   emf.MetaFieldType as EntityMetaField_MetaFieldType,
	   emf.MetaFieldDescription as EntityMetaField_MetaFieldDescription
from EntityMetaFieldLinks emfl
inner join EntityMetaFields emf on emf.EntityMetaFieldId = emfl.EntityMetaFieldId
where emfl.EntityMetaFieldLinkId = @Id

GO

